package cate.game.chat;

import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

import java.util.ArrayList;
import java.util.List;

@NoteClass(value = "聊天内容参数")
public class ChatContentParam {

    /** 直接字符串补充，最基础的 */
    public static final int TYPE_STRING = 0;
    /** 英雄ID */
    public static final int TYPE_HERO_ID = 1;
    /** 装备ID */
    public static final int TYPE_EQUIP_ID = 2;
    /** 道具ID */
    public static final int TYPE_PROP_ID = 3;
    /** 英雄碎片ID */
    public static final int TYPE_HERO_PART_ID = 4;
    /** 徽章ID */
    public static final int TYPE_RUNE_ID = 5;
    /** 香料(以前的命格)ID */
    public static final int TYPE_SPICE_ID = 6;
    /** 灵器ID */
    public static final int TYPE_FAIRY_ID = 7;
    /** 灵器碎片ID */
    public static final int TYPE_FAIRY_FRAGMENT_ID = 8;
    /** 家具ID */
    public static final int TYPE_FURNITURE_ID = 13;
    /** 宝物ID */
    public static final int TYPE_TREASURE_ID = 14;
    /** 载具ID */
    public static final int TYPE_VEHICLE_ID = 16;
    /** 角色ID */
    public static final int TYPE_ROLE_ID = 100;
    /** 公会ID */
    public static final int TYPE_GUILD_ID = 101;
    /** lang表ID */
    public static final int TYPE_LANG_ID = 102;
    /** 情报任务ID */
    public static final int INFO_TASK_ID = 1009;
    /** 混合资源 */
    public static final int TYPE_MIX_RES = 10000;

    @NoteField(value = "参数类型")
    public int type;

    @NoteField(value = "参数值")
    public Object value;

    public static ChatContentParam c(int type, Object value) {
        ChatContentParam item = new ChatContentParam();
        item.type = type;
        item.value = value;
        return item;
    }

    public static ChatContentParam c(Object value) {
        return c(TYPE_STRING, value);
    }

    public static List<ChatContentParam> wrap(List<Object> objList) {
        List<ChatContentParam> l = new ArrayList<>();
        for(Object obj : objList) {
            l.add(c(obj));
        }
        return l;
    }

}
